package java_generics;

public class NaturalNo {
	
	// use instance variable instead of Generic
	private int n;
	public NaturalNo(int n) {
		this.n = n;
	}
	public String isEven() {
		if (n % 2 == 0) {
			return "even";
		} else {
			return "odd";
		}
	}
	public int get() {
		return n;
	}
	public static void main(String[] args) {
		NaturalNo x = new NaturalNo(20);
		System.out.printf("%d is %s", x.get(), x.isEven());

		System.out.println("\n");

		NaturalNo y = new NaturalNo(15);
		System.out.printf("%d is %s", y.get(), y.isEven());

		// NaturalNumber2 z = new NaturalNumber2("abc"); // Not Integer

	}
}

// 20 is even

// 15 is odd
